package net.huashitong.synthetical.jobOversee.dao;

import com.sirdc.modules.core.dao.GenericQuery;
import com.sirdc.modules.core.dao.StringDao;
import com.sirdc.modules.utils.StringUtils;
import net.huashitong.synthetical.jobOversee.entity.JobGroup;
import net.huashitong.synthetical.jobOversee.filter.JobGroupFilter;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public class JobGroupDao extends StringDao<JobGroup> {

    /**
     * 获取督查组表列表
     * @param filter
     * @return
     */
    public List<JobGroup> getJobInfo(JobGroupFilter filter)
    {
        GenericQuery query  = createQuery( "obj");
        if(StringUtils.isNotBlank(filter.getGroupName()))
        query.append(" and obj.groupName=:groupname").setParam("groupname",filter.getGroupName());

        return query.listResult(filter);
    }

}
